package src.lab02.text21;

/**
 * Created by 12442 on 2017/11/1.
 */
public class Text1 {
    public static void main(String[] args) {
        char a='2';
        String string="216514651232514612";
        System.out.println(getCharCount(a,string));
    }

    public static int getCharCount(char a,String string){
        int count=0;
        for(int i=0;i<string.length();i++){
            char temp =string.charAt(i);
            if(a==temp)
                count++;
        }
        return count;
    }
}
